<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8" />
    <title>下单页-{eyou:global name='web_name' /}</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
    <link href="{eyou:global name='web_cmspath'/}/favicon.ico" rel="shortcut icon" type="image/x-icon" />
    {eyou:static file="users/skin/css/bootstrap.min.css" /}
    {eyou:static file="users/skin/css/eyoucms.css" /}
    {eyou:static file="users/skin/css/basic.css" /}
    {eyou:static file="users/skin/css/shop.css" /}
    <!-- 新样式 2020-12-8 -->
    {eyou:static file="users/skin/css/element/index.css" /}
    {eyou:static file="users/skin/css/e-user.css" /}
    {eyou:include file="users/skin/css/diy_css.htm"/}

    {eyou:static file="/public/static/common/js/jquery.min.js"/}
    {eyou:static file="/public/plugins/layer-v3.1.0/layer.js"/}
    {eyou:static file="/public/static/common/js/tag_global.js"/}
</head>

<body>
{eyou:include file="users/users_header.htm" /}
    <!-- 头部信息 -->
    <div class="ey-header-status">
        <div class="header-status-l">
            <a href="javascript:history.go(-1)"><i class="el-icon-arrow-left"></i></a>
        </div>
        <div class="header-status-m">提交订单</div>
        <div class="header-status-r">
            <a href="{eyou:url link='user/Users/index' /}"><i class="el-icon-user"></i></a>
        </div>
    </div>
    <!-- 头部信息结束 -->
    <div class="h50"></div>

    <div class="ey-container">
        <div class="el-row">
            <div data-plugin="selectable" data-selectable="selectable">
                <form action="" name='theForm' id="theForm" method="post">
                    {eyou:spsubmitorder id="field"}
                        <div class="ey-row bgfff">
                            <!-- 判断是否填写商城配置中的温馨提示信息 -->
                            {eyou:notempty name="$field.shop_prompt"}
                                <div class="el-row"> <div class="mb20 red"> 温馨提示：{$field.shop_prompt} </div> </div>
                            {/eyou:notempty}

                            <!-- 判断是否属于实体产品,虚拟产品不需要收货地址 -->
                            {eyou:empty name="$field.PromType"}
                                <div class="ey-row-box mb10">
                                     <div class="box-l"><a href="JavaScript:void(0);" {$field.ShopAddAddr} class="el-button el-button--primary el-button--small">添加收货地址</a></div>
                                     <div class="box-r"><a href="javascript:void(0);" {$field.goAddressList}>管理收货地址</a></div>
                                </div>

                                <ul class="address-con address-con2" {$field.UlHtmlId}>
                                    {eyou:volist name='$field.ShopAddressInfo' id='addr_field'}
                                        <input type="hidden" name="addr_id" id="addr_id" value="{$addr_field.addr_id}">
                                        <li class="el-col el-col-24" {$addr_field.ul_il_id}>
                                            <div class="address-item flex box">
                                                <div class="address-item-l">
                                                    <div class="txt-row f16 fb">
                                                        <span id="addr_consignee">{$addr_field.consignee}</span>
                                                        <span id="addr_mobile">{$addr_field.mobile}</span>
                                                    </div>
                                                     <div class="txt-row">
                                                         <span id="addr_Info">{$addr_field.Info}</span>
                                                     </div>
                                                     <div class="txt-row">
                                                         <span id="addr_address">{$addr_field.address}</span>
                                                     </div>
                                                </div>
                                            </div>
                                        </li>
                                    {/eyou:volist}
                                </ul>
                            {eyou:else/}
                                <div class="el-row">
                                    <!-- 虚拟产品输出信息，可根据自身需求更改 -->
                                    <div class="mb20 red">
                                        该产品为虚拟产品，仅支持在线支付且无需选择收货地址及运费计算。<br/>
                                        若产品是充值类产品，请将您的手机号或需充值的卡号填入留言中。
                                    </div>
                                </div>
                            {/eyou:empty}
                        </div>

                        {notempty name="$field.TotalAmount"}
                        <div class="el-row p10 bgfff mt10">
                            <div class="column-title">
                                <div class="column-name">{eyou:eq name="$field.use_pay_type" value="0"}未开启支付方式{eyou:else/}支付方式{/eyou:eq}</div>
                            </div>
                            {$field.PayTypeHidden}
                            <div class="pay-type">
                                <div class="li_div">
                                    <div class="pay-con">
                                        <!-- 支付API列表，套板请务必将整块代码一起复制，包含隐藏域 -->
                                        <script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.3.2.js"></script>
                                        {eyou:sppayapilist id='vo'}
                                            {eyou:notempty name="$vo.pay_id"}
                                                {neq name="$vo.pay_mark" value="Hupijiaopay"}
                                                    {eyou:php}$pay_mark_vars = "users/skin/images/pay_".$vo['pay_mark'].".png";{/eyou:php}
                                                    <div class="pay-type-item" data-type="zxzf_{$vo.pay_mark}" onclick="payTag2(this)">
                                                        <img src="{eyou:empty name='$vo.pay_img'}{eyou:static file='$pay_mark_vars' /}{eyou:else/}{$vo.pay_img}{/eyou:empty}" alt="{$vo.pay_name}" height="100%" width="100%">
                                                        <i class="el-icon-check"></i>
                                                    </div>
                                                {/neq}
                                            {/eyou:notempty}
                                            {$vo.hidden}
                                        {/eyou:sppayapilist}
                                        <input type="hidden" id="PayID">
                                        <input type="hidden" id="PayMark">
                                        <input type="hidden" id="PayType">
                                        <!-- END -->

                                        {eyou:eq name="$field.pay_balance_open" value="1"}
                                        <div class="pay-type-item" data-type="yezf_balance" onclick="payTag2(this)">
                                            <img src="{eyou:static file='users/skin/images/pay_yiyou2.png' /}" alt="余额支付" height="100%" width="100%">
                                            <i class="el-icon-check"></i>
                                        </div>
                                        {/eyou:eq}

                                        {eyou:if condition="empty($field.shop_open_offline) && empty($field.PromType)"}
                                        <!-- 判断是否开启商城配置中的货到付款开关 并且 判断是否属于实体产品，虚拟产品不支付货到付款 -->
                                        <div class="pay-type-item" data-type="hdfk_payOnDelivery" onclick="payTag2(this)">
                                            <img src="{eyou:static file='users/skin/images/pay_hdfk.png' /}" alt="货到付款" height="100%" width="100%">
                                            <i class="el-icon-check"></i>
                                        </div>
                                        {/eyou:if}
                                    </div>
                                    <div class="pay-inner-con" id="yezf_balance_tips" style="display: none;">
                                        <div class="el-col el-col-24">
                                            应付金额：
                                           <span class="red f16">{$field.TotalAmount}</span> 元
                                        </div>
                                        <div class="el-col el-col-24">
                                            可用余额：
                                            <span class="green f16">{$field.UsersMoney}</span > 元
                                            {lt name='$field.UsersSurplusMoney' value='0'}
                                            <span class="red ml10">余额不足<a href="{:url('user/Pay/pay_account_recharge')}" target="_blank">[充值]</a></span>
                                            {/lt}
                                        </div>
                                        <div class="el-col el-col-24">
                                            支付结余：
                                          <span class="fb">{$field.UsersSurplusMoney}</span> 元
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        {/notempty}

                        <!-- 判断是否属于实体产品,虚拟产品不支付配送方式 -->
                        {eyou:empty name="$field.PromType"}
                        <div class="el-row p10 bgfff mt10">
                            <div class="column-title">
                                <div class="column-name">配送方式</div>
                            </div>
                            <div class="mt20 mb10">
                                快递配送 ( {$field.Shipping} )
                            </div>
                        </div>
                        {/eyou:empty}

                        <div class="el-row p10 bgfff mt10">
                            <div class="column-title">
                                <div class="column-name">商品信息</div>
                            </div>
                            <div class="mt20 mb10 order-goods goods-con">

                                <div class="goods-item">
                                    <div class="item-main">
                                        <!-- 获取订单商品 -->
                                        {eyou:spordergoods id="shop_field"}
                                        <div class="item-con">
                                            <div class="item-con-l">
                                                <a href="{$shop_field.arcurl}"><img src="{$shop_field.litpic}"></a>
                                            </div>
                                            <div class="item-con-m">
                                                <a href="{$shop_field.arcurl}">{$shop_field.title}</a>
                                                <div class="info mt5">
                                                    <!-- 商品规格 -->
                                                    {$shop_field.product_spec}
                                                    <!-- 商品规格 END-->
                                                    <!-- 商品参数 -->
                                                    {eyou:attribute type='newattr' aid='$shop_field.aid' attrid='$shop_field.attrlist_id'}
                                                        <div>{$attr.name}：{$attr.value}</div>
                                                    {/eyou:attribute}
                                                    <!-- 商品新参数 END-->
                                                </div>
                                            </div>
                                            <div class="item-con-r">
                                                <span class="price_flag">￥</span><span>{$shop_field.users_price}</span>
                                                <p class="number">x{$shop_field.product_num}</p>

                                            </div>
                                        </div>
                                        {$shop_field.ProductHidden}
                                        {/eyou:spordergoods}
                                    </div>
                                </div>
                            </div>
                        </div>

                        <div class="el-row p10 bgfff mt10">
                            <div class="column-title">
                                <div class="column-name">留言备注</div>
                            </div>
                            <div class="mt20 mb10">
                                <textarea class="el-textarea__inner" rows="3" name="message" placeholder="给商家留言，选填"></textarea>
                            </div>
                        </div>

                        <div class="h50"></div>
                        <div class="shopcar-footer">
                            {$field.TotalAmountOld}
                            <div class="shopcar-footer-l">
                                共选中：<span class="red">{$field.TotalNumber}</span> 件商品
                            </div>
                            <div class="shopcar-footer-r">
                                <span class="price">合计:<i>￥</i><em {$field.TotalAmountId}>{$field.TotalAmount}</em></span>
                                {eyou:eq name="is_wechat" value='2'}
                                    <input type="button" name="submit" value="提交订单" class="el-button el-button--primary el-button--medium" {$field.ShopPaymentPage} >
                                {eyou:else/}
                                    <input type="button" name="submit" value="提交订单" class="el-button el-button--primary el-button--medium" onclick="WeChatPayment();" >
                                    </a>
                                {/eyou:eq}
                            </div>
                        </div>
                    {$field.TokenValue}
                    {$field.hidden}
                    {/eyou:spsubmitorder}
                </form>
            </div>

        </div>

        <input type="hidden" id="unified_id">
        <input type="hidden" id="unified_number">
        <input type="hidden" id="transaction_type">
    </div>
<script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.3.2.js"></script>
{eyou:static file="users/skin/js/shop_under_order.js"/}

<script type="text/javascript">
    $(function(){
        // 默认支付方式
        $($('.pay-type-item')[0]).trigger("click");
    });
</script>
